<template>
  <ZgDialog v-model="visible" title="查看公告" width="60%" :showFooter="false">
    <div><h1>{{ title }}</h1></div>
    <div class="mb30" >{{ author }}&nbsp;发布于&nbsp;{{ updateTime }}</div>
    <div v-html="content" class="wfull rich-text"></div>
    <div class="attach-box">
      <div v-for="(f,i) in fileArr" :key="`attach${i}`"><i class="fa fa-paperclip mr5"/>{{ f.fileName }}</div>
    </div>
  </ZgDialog>
</template>
<script>
export default {
  data () {
    return {
      title: '',
      updateTime: '',
      author: '',
      content: '',
      fileArr: [],
      visible: false
    }
  },
  methods: {
    open (annId) {
      this.$http.get('/zg-system/ann/info', { annId: annId }, data => {
        this.title = data[0].title
        this.updateTime = data[0].updateTime
        this.author = data[0].author
        this.content = data[1].content
        this.fileArr = data[2]
        this.visible = true
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.attach-box{
  border-top:dashed 1px #ddd;padding:10px;margin-top:60px;
}
</style>
